<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
    <title>求职者信息管理</title>
    <link href="/js/bstable/css/bootstrap.min.css" rel="stylesheet" type="text/css">
    <link href="/js/bstable/css/bootstrap-table.css" rel="stylesheet" type="text/css">
    <link href="/css/table.css" rel="stylesheet" type="text/css">

    <script src="/js/vue.js"></script>
    <script src="/js/axios.min.js"></script>
</head>
<body style="background-color: #ecf0f5;font-family: 微软雅黑;color: #475059;min-width: 1000px;overflow: auto">
<div id="app">
    <!--    <div  class="notice_main">-->
    <!--        <table id="table" class="table_style" style="margin: 0 auto" > </table>-->
    <!--    </div>-->
    <script src="/js/jquery/jQuery-2.2.0.min.js"></script>
    <script src="/js/bstable/js/bootstrap.min.js"></script>
    <script src="/js/bstable/js/bootstrap-table.js"></script>
    <script src="/js/bstable/js/bootstrap-table-zh-CN.min.js"></script>
    <script src="/js/layer_v2.1/layer/layer.js"></script>

    <table class="table table-bordered  table-hover">
        <div class="notice_check">

            <div class="l_left">
                <input type="text" v-model="comName" name="comName" class="form-control" placeholder="请输入姓名">


            </div>
            <button type="button" @click="queryCom()" class="btn btn-primary">查询</button>
        </div>
        <tr>
            <th type="radio">▢</th>
            <th>编号</th>
<!--            <th>公司ID</th>-->
            <th>公司全称</th>
            <th>公司账号</th>
            <th>公司密码</th>
            <th>公司图片</th>
            <th>公司电话</th>
            <th>公司邮箱</th>
<!--            <th>职位ID</th>-->
            <!--            <th>工作时间</th>-->
            <th>公司地址</th>
            <th>工作地点</th>
            <th>注册日期</th>
            <th>创建日期</th>
            <th>是否需要融资</th>
            <th>法定代表人</th>
            <th>操作</th>
        </tr>
        <tr v-for="(item,index) in companyList">
            <td><label>
                <input type="checkbox"   id="inlinecheckbox1" value="true">
            </label></td>
            <td> {{index+1}} </td>
<!--            <td>{{item.company_id}}</td>-->
            <td>{{item.company_name}}</td>
            <td>{{item.company_number}}</td>
            <td>{{item.company_pass}}</td>
            <td>{{item.company_img_url}}</td>
            <td>{{item.company_tel}}</td>
            <td>{{item.company_email}}</td>
<!--            <td>{{item.job_id}}</td>-->
            <!--            <td>{{company_time}}</td>-->
            <td>{{item.company_add}}</td>
            <td>{{item.job_add}}</td>
            <td>{{item.company_date}}</td>
            <td>{{item.create_date}}</td>
            <td>{{item.financing}}</td>
            <td>{{item.legal_person}}</td>
            <td> <a   @click="delCompany(item.company_id)">删除</a></td>
        </tr>
    </table>
</div>
</body>
</html>
<script>
    new Vue({
        el:"#app",
        data:{
            comName:'',
            companyList:[]
        },
        methods:{
            queryCom:function (){
                _this = this
                //查询公司信息
                axios.get('/company/list1',{
                    params: {
                        comName:this.comName
                    }
                }).then(function (response) {
                    _this.companyList=response.data;
                    console.log(response.data);
                })
                    .catch(function (error) {
                        console.log(error);
                    });
            },
            delCompany:function (company_id){
                // alert(company_id)
                window.localStorage.setItem("sid", company_id);
                location.href="company_manage.html"
                axios.get('/company/del',{
                    params:{
                        company_id: company_id
                    }
                }).then(function (response){
                    console.log(response.data);
                })
                    .catch(function (error){
                        console.log(error);
                    });
            },
        },
        mounted() {
            _this = this
            axios.get('/company/list1',{
                params: {
                    comName: this.comName

                }
            }).then(function (response){
                _this.companyList=response.data;
                console.log(response.data);
            })
                .catch(function (error){
                    console.log(error);
                });
        }
    })
</script>